<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>未读回复</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">

    <link rel="stylesheet" href="/gupiao/css/weui.css">
    <link rel="stylesheet" href="/gupiao/css/jquery-weui.css">
    <link rel="stylesheet" href="/gupiao/css/style.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_689900_tgundrn0e1a46lxr.css">

    <style>
        .index-xingchengz .weui-cells{font-size: 15px;margin-top:0;}
        .xingchengz .weui-cells .weui-cell{padding-top:5px;padding-bottom:5px;}
        .xingchengz .weui-cells .weui-cell:before{border:0;}
        .xingchengz .weui-cells:after{border:0;}
        .xingchengz .weui-cells{margin-top:0;}
        .xingchengz .weui-cells:before{ border-top:0;}
        .xingchengz .weui-cells .weui-cell__hd span.dianf{background-color:#fff;display: block; width: 5px;height: 5px;border-radius: 50%;margin-right: 3vw}
        .xingchengz .weui-cells .weui-cell__hd span.dian{background-color:#33c2a4;display: block; width: 5px;height: 5px;border-radius: 50%;margin-right: 3vw}
        .xingchengz .weui-cells .weui-cell__hd span.dian2{background-color:#ff8a5a;display: block; width: 5px;height: 5px;border-radius: 50%;margin-right: 3vw}
    </style>
</head>
<body class="back1">

<div class="index-top-fix">
    <a href="{:url('index/gupiao.mycenter/mycenter')}" class="iconfont icon-left- left"></a>
    <p class="title">未读回复</p>
</div>

<div class="mt50"></div>

<div id="list">

</div>


</body>
</html>
<script src="/gupiao/js/jquery.min.js"></script>
<script src="/gupiao/js/jquery-weui.min.js"></script>

<script>
    $(function(){
        $.ajax({
            type : "GET",
            url : "{:url('gupiao.article/unRead')}",
            dataType:'json',
            success : function (res) {
                if(res.code == 200){
                    var   banner  = res.data;
                    var  html    = '';
                    for(var i=0;i<banner.length;i++){
                        var data = res.data[i];
                        if(data.is_read == "1"){
                            // 已读
                            html +='<div class="index-box index-xingchengz" id='+data.id+'>'+
                                '<div class="weui-cell left0">'+
                                '<div class="weui-cell__bd xingchengz">'+
                                '<div class="weui-cells">'+
                                '<div class="weui-cell">'+
                                '<div class="weui-cell__hd">'+
                                '<img src='+data.avatar+' width="50">'+
                                '</div>'+
                                '<div class="weui-cell__bd">'+
                                '<p style="margin-left: 10%;">'+data.name+'' +
                                '<span style="margin-left: 3%;color:red; ">未读</span></p>'+
                                '</div>'+
                                '</div>'+
                                '<div class="weui-cell">'+
                                '<div class="weui-cell__hd">'+
                                '<span class="dian2"></span>'+
                                '</div>'+
                                '<div class="weui-cell__bd">'+
                                '<p>'+data.content+'</p>'+
                                '</div>'+
                                '</div>'+
                                '<div class="weui-cell">'+
                                '<div class="weui-cell__hd">'+
                                '<span class="dian"></span>'+
                                '</div>'+
                                '<div class="weui-cell__bd">'+
                                '<p>'+data.time+'</p>'+
                                '</div>'+
                                '</div>'+
                                '</div>'+
                                '</div>'+
                                '</div>'+
                                '</div>'
                        }
                        else if(data.is_read == "0"){
                            // 未读
                            html +='<div class="index-box index-xingchengz" id='+data.id+'>'+
                                '<div class="weui-cell left0">'+
                                '<div class="weui-cell__bd xingchengz">'+
                                '<div class="weui-cells">'+
                                '<div class="weui-cell">'+
                                '<div class="weui-cell__hd">'+
                                '<img src='+data.avatar+' width="50">'+
                                '</div>'+
                                '<div class="weui-cell__bd">'+
                                '<p style="margin-left: 10%;">'+data.name+'' +
                                '<span style="margin-left: 3%;color:red; ">未读</span></p>'+
                                '</div>'+
                                '</div>'+
                                '<div class="weui-cell">'+
                                '<div class="weui-cell__hd">'+
                                '<span class="dian2"></span>'+
                                '</div>'+
                                '<div class="weui-cell__bd">'+
                                '<p>'+data.content+'</p>'+
                                '</div>'+
                                '</div>'+
                                '<div class="weui-cell">'+
                                '<div class="weui-cell__hd">'+
                                '<span class="dian"></span>'+
                                '</div>'+
                                '<div class="weui-cell__bd">'+
                                '<p>'+data.time+'</p>'+
                                '</div>'+
                                '</div>'+
                                '</div>'+
                                '</div>'+
                                '</div>'+
                                '</div>'
                        }
                    }
                    $("#list").html(html);

                       // 这个地方是实现留言回复查看
                    var pid;
                    $('#list div').on('click', function(){

                        pid = $(this).attr('id');
                        location.href ="{:url('index/gupiao.mycenter/unreadlnfo')}?id="+pid;

                    });
                }
            }
        })
    })
</script>
